home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / utils / stlogin4.lzh / UTMP.H < prev    next >
C/C++ Source or Header  |  1993-04-25  |  2KB  |  58 lines

  1. #ifndef _UTMP_INCLUDED  /* allows multiple inclusion */
  2. #define _UTMP_INCLUDED
  3.  
  4. #include <time.h>
  5.  
  6. #define    UTMP_FILE    "u:\\etc\\utmp"
  7. #define    WTMP_FILE    "u:\\etc\\wtmp"
  8. #define    BTMP_FILE    "u:\\etc\\btmp"
  9. #define    ut_name    ut_user
  10.  
  11. struct utmp
  12. {    char ut_user[8];            /* User login name */
  13.     char ut_id[4];                 /* /etc/lines id(usually line #) */
  14.     char ut_line[15];            /* device name (console, lnxx) */
  15.     short ut_pid;
  16.     short ut_type;                /* type of entry */
  17.     unsigned short ut_res1;        /* Reserved for future use */
  18.     time_t ut_time;                /* time entry was made */
  19.   };
  20.  
  21. /*    Definitions for ut_type    */
  22.  
  23. #define    EMPTY            0
  24. #define    RUN_LVL            1
  25. #define    BOOT_TIME        2
  26. #define    OLD_TIME        3
  27. #define    NEW_TIME        4
  28. #define    INIT_PROCESS    5    /* Process spawned by "init" */
  29. #define    LOGIN_PROCESS    6    /* A "getty" process waiting for login */
  30. #define    USER_PROCESS    7    /* A user process */
  31. #define    DEAD_PROCESS    8
  32. #define    ACCOUNTING        9
  33. #define    UTMAXTYPE    ACCOUNTING   /* Largest legal value of ut_type */
  34.  
  35.  
  36. /*    Special strings or formats used in the "ut_line" field when
  37.     accounting for something other than a process.
  38.     No string for the ut_line field can be more than 11 chars +
  39.     a NULL in length.
  40. */
  41.  
  42. #define    RUNLVL_MSG    "run-level %c"
  43. #define    BOOT_MSG    "system boot"
  44. #define    OTIME_MSG    "old time"
  45. #define    NTIME_MSG    "new time"
  46.  
  47. extern struct utmp *getutent(void);
  48. extern struct utmp *getutid(struct utmp *);
  49. extern struct utmp *getutline(struct utmp *);
  50. extern void pututline(struct utmp *);
  51. extern void setutent(void);
  52. extern void endutent(void);
  53. extern void utmpname(char *file);
  54.  
  55. extern int utmp_fd;
  56.  
  57. #endif /* _UTMP_INCLUDED */
  58.